<template>
	<view>
		<!-- 头部标题 -->
		<view class="cu-bar bg-white">
			<view class="action sub-title">
				<text class="text-xl text-bold text-green">课堂详细</text>
				<text class="bg-green"></text>
				<!-- last-child选择器-->
			</view>
		</view>
		<!-- 头部标题 end -->
		
		
		<!-- 头部内容区域 -->
		
		<view class="bg-gradual-blue padding  text-center shadow-blur" style="width: 100vw;height: 300upx; display: flex;justify-content: center;align-items: center;">
			
			
			<view style="display: flex;flex-direction: column;justify-content: center;align-items: center;">
				<text style="font-size: 40upx;">{{className}}</text>
				<text style="margin-top: 20upx;">{{banji}}</text>
			</view>
			
		</view>
		
		<!-- end -->
		
		<!-- 定位 导航栏 -->
		<view class="padding radius text-center shadow-blur bg-cyan" style="display: flex;width: 90vw;margin-left: 5vw;height: 200upx;position: absolute;top: 310upx;align-items: center;justify-content:space-around;">
			
			
			<view @click.native="toPageDesc(0)"  style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
				<image  style="height: 100upx;width: 100upx;border-radius: 100%;" src="../../../static/logo.png"></image>
				<text style="margin-top: 15upx;">发布签到</text>
			</view>
			
			<view  @click.native="toPageDesc(1)" style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
				<image style="height: 100upx;width: 100upx;border-radius: 100%;" src="../../../static/logo.png"></image>
				<text style="margin-top: 15upx;">发布作业</text>
			</view>
			
			<view   @click.native="toPageDesc(2)" style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
				<image style="height: 100upx;width: 100upx;border-radius: 100%;" src="../../../static/logo.png"></image>
				<text style="margin-top: 15upx;">发布抢答</text>
			</view>
			
		</view>
		<!-- end -->
		
		
		
		<!-- 人数 -->
		<view class="" style="display: flex;justify-content: space-between;margin-top: 100upx;padding: 30upx;">
			<text style="font-weight: 600;">成员总数</text>
			<text>89人</text>
		</view>
		<!-- end -->
		
		<view class="" style="margin-left: 5vw; width: 90vw;height: 1upx;background: #AAAAAA;"></view>
		
		<!-- 列表 -->
		<view class="shadow-blur shadow-warp" v-for="(item,index) in listData" :key ="index" @click.native="toPageDesc(3,index)">
			
		<view class="bg-white" style="padding: 20upx; width: 100vw;height: 150upx;margin-top: 10upx;display: flex;align-items: center;">
			
			<text style="color: red;">1</text>
			
			<image style="width: 100upx;height: 100upx;margin-left: 10upx;" src="../../../static/logo.png"></image>
			
			<view style="display: flex;flex-direction: column;margin-left: 20upx;width: 50vw;">
				<text >{{item.studentName}}</text>
				<text style="margin-top: 15upx;">{{item.idcard}}</text>
			</view>
			
			<view class="" style="display: flex;align-content: center;justify-content: center;">
				<text style="margin-right: 20upx;margin-top: -5upx;"><text style="color: red;margin-right: 10upx;">{{item.score}}</text>分数</text>
				<text class="lg text-gray cuIcon-right"></text>
			</view>
		</view>
		
		<!-- <view class="" style="margin-left: 5vw; width: 90vw;height: 1upx;background: #AAAAAA;margin-top: 10upx;"></view> -->
		
		</view>
		<!-- end -->
		
		
	</view>
</template>

<script>
	var _this;
	export default {
		data() {
			return {
				listData:[],//列表数据
				classId:"",//课程id
				className:'',//课程名称
				banji:"",//班级名称
				
				
			}
		},
		methods: {
			toPageDesc:function(index,_index){
				
				if(index == 0){//跳转签到详细页面
					uni.navigateTo({
						url: '/pages/sign/sign_t/sign_t' + "?classId=" + _this.classId,
					});
				}else if(index == 1){//作业页面
					uni.navigateTo({
						url: '/pages/worklist/workLIst_t/workLIst_t' + "?classId=" + _this.classId,
					});
				}else if(index == 2){//抢答页面
					uni.navigateTo({
						url: '/pages/answer/answer_t/answer_t' + "?classId=" + _this.classId,
					});
				}else if(index == 3){//跳转学生详细页面
					var data =  _this.listData[_index];
					console.log(data.uid);
					uni.navigateTo({
						url: '/pages/classDesc/classDesc_t/StudentDesc_t?studentName=' + data.studentName + "&idcard=" + data.idcard + "&classId=" + _this.classId + "&studentId=" + data.uid ,
					});
				}
			},
			
			// 获取列表数据
			getClassDescData:function(id){
				uni.request({
					url:_this.api + "join/getMember",
					method:"POST",
					header:{
						"content-type":"application/x-www-form-urlencoded"
					},
					data:{
						clazzId	: id
					},
					success: (res) => {
						_this.listData = res.data.data;
					},
					fail: (err) => {
						uni.showToast({
							title:"查询数据失败！请稍后在试~~",
							icon:"none",
							duration:1000
						})
					}
				})
			},
		},
		onLoad(options) {
			_this = this;
			_this.classId = options.id
			this.getClassDescData(options.id);
			_this.className = options.className;
			_this.banji = options.banji;
		}
	}
</script>

<style>

</style>
